//
//  DCWNavigationViewController.m
//  Meng800
//
//  Created by 姚宗超 on 14/7/20.
//  Copyright (c) 2014年 点财网. All rights reserved.
//

#import "MPNavigationViewController.h"

@interface MPNavigationViewController ()

@end

@implementation MPNavigationViewController

- (id)initWithRootViewController:(UIViewController *)rootViewController
{
    if (self = [super initWithRootViewController:rootViewController]) {
        // 定义通用格式
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (BOOL)popToViewControllerByClass:(Class)cls
{
    NSArray* stackedVC = [self viewControllers];
    for (UIViewController* vc in stackedVC) {
        if ([vc isKindOfClass:cls]) {
            [self popToViewController:vc animated:YES];
            return YES;
        }
    }
    return NO;
}

@end
